#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void paintEvent(QPaintEvent *event);
    void huashe();
    void keyPressEvent(QKeyEvent *event);
    QRect applecreate();//shi wu
    QRect applecreate2();//shi wu
    QRect applecreate3();//shi wu
    void eat();
    void ziji();
private slots:
    void gengxin();
private:
    Ui::MainWindow *ui;
    //QRect sheshen;
    QTimer *timer;//ding shi qi
    int fangxiang;//yi dong fang xiang
    int fangxiang2;//yi dong fang xiang
    bool blsrun;//shi fou kai shi
    bool blsend;//shi fou jie shu
    QVector<QRect> sheshen;//she
    QRect shetou;//she tou
    QVector<QRect> sheshen2;//she
    QRect shetou2;//she tou
    QString display;//kai shi
    QRect apple;//shi wu
    QRect apple2;//shi wu
    QRect apple3;//shi wu
    int fen;//fen
    int Speed;//su du
};

#endif // MAINWINDOW_H
